﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using WeifenLuo.WinFormsUI.Docking;

namespace UI_Editor.DckForm
{
    public partial class ToolsForm : DockContent
    {
        //public static ListView ListView;//控件列表
        //public static Cursor cursor;    //鼠标光标

        public ToolsForm()
        {
            InitializeComponent();
            //ListView = this.listView;
            MainForm.listView = this.listView;
        }

        private void btn3_Click(object sender, EventArgs e)
        {
            listView.View = View.List;
        }

        private void btn1_Click(object sender, EventArgs e)
        {
            listView.View = View.LargeIcon;
        }

        private void btn2_Click(object sender, EventArgs e)
        {
            listView.View = View.SmallIcon;
        }

        private void listView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listView.SelectedItems.Count > 0)
            {
                //获取选中控件的图像转化为光标
                int index = listView.SelectedItems[0].ImageIndex;
                MainForm.Img = listView.LargeImageList.Images[index];
                MainForm.cursor = MainForm.T.GetCursor(MainForm.T.ToBitmap(MainForm.Img));
            }
        }
    }
}
